const getters = {
	// 改属性废弃,不用了
	unishow: (state) => {
		let value = state.orders.dealType;
		if (value == "JTALL") return false;
		return true;
	},

	ceilOrderType: (state) => state.orders.dealType,

	currCard: (state) => {
		const type = state.orders.dealType;
		// if (type == "MY") return "CustItemCard";
		// else return "OrderItemCard";
		return "OrderItemCard";
	},
	Card: (state) => {
		return state.orders.showTypeName
	},
	searchTypeOptions: () => {
		return [
			{ value: 1, name: "流水号" },
			{ value: 2, name: "客户名称" },
			{ value: 3, name: "客户编号" },
			{ value: 4, name: "单据阶段" },
			{ value: 5, name: "电路代号/设备号" },
			{ value: 6, name: "业务经理" },
			{ value: 7, name: "产品名称" },
			{ value: 8, name: "项目编号" },
			{ value: 10, name: "原流水号" },
			{ value: 11, name: "IDC群号" },
			{ value: 12, name: "产品实例ID" },
			{ value: 13, name: "合同编码" },
			{ value: 14, name: "商机编码" },
		];
	},
	stageOptions: () => {
		return [
			{ value: "1", name: "全部" },
			{ value: "2", name: "预警" },
			{ value: "3", name: "超期" },
			{ value: "4", name: "到期" },
		];
	},
	warnOptions: () => {
		return [
			{ value: "1", name: "全部" },
			{ value: "2", name: "一级告警" },
			{ value: "3", name: "二级告警" },
			{ value: "4", name: "三级告警" },
		];
	},

	conditions: (state) => {
		let conditions = {
			systemUserId: state.user.user.acctId,
			staffId: state.user.user.staffId,
			orgId: state.user.user.orgId,
			pubOrderStage: '',
			pageInfo: state.orders.pageInfo,
			qryType: state.orders.qryType,
			qryValue: state.orders.qryValue,
			stage: state.orders.stage,
			dealType: state.orders.dealType,
			orderStage: state.orders.orderStage,
			orderStageId: state.orders.orderStageId,
			orderType: state.orders.orderType,

			B_REQ_AUD_DATE: state.orders.B_REQ_AUD_DATE,
			E_REQ_AUD_DATE: state.orders.E_REQ_AUD_DATE,
			B_ORDER_AUD_DATE: state.orders.B_ORDER_AUD_DATE,
			E_ORDER_AUD_DATE: state.orders.E_ORDER_AUD_DATE,
			B_FINISH_TIME: state.orders.B_FINISH_TIME,
			E_FINISH_TIME: state.orders.E_FINISH_TIME,
			B_FINISH_OPER_DATE: state.orders.B_FINISH_OPER_DATE,
			E_FINISH_OPER_DATE: state.orders.E_FINISH_OPER_DATE,
			B_BEGIN_RENT_TIME: state.orders.B_BEGIN_RENT_TIME,
			E_BEGIN_RENT_TIME: state.orders.E_BEGIN_RENT_TIME,
			B_HANDLE_TIME: state.orders.B_HANDLE_TIME,
			E_HANDLE_TIME: state.orders.E_HANDLE_TIME,
			CUST_SO_NUMBER: state.orders.CUST_SO_NUMBER,
			CUST_SO_NUMBER_TYPE: state.orders.CUST_SO_NUMBER_TYPE,
			CUST_NUMBER: state.orders.CUST_NUMBER,
			CUST_NUMBER_TYPE: state.orders.CUST_NUMBER_TYPE,
			ACC_NBR: state.orders.ACC_NBR,
			ACC_NBR_TYPE: state.orders.ACC_NBR_TYPE,
			CUST_NAME: state.orders.CUST_NAME,
			CUST_NAME_TYPE: state.orders.CUST_NAME_TYPE,
		};
		let result = {};
		for (const key in conditions) {
			if (conditions[key]) {
				result[key] = conditions[key];
			}
		}
		return result;
	},
	countConditions: (state) => {
		let result = {
					userId: state.user.user.staffId,
					orgId: state.user.user.orgId,
			    staffId: state.user.user.staffId,
					systemUserId: state.user.user.acctId,
					flag: "1",
					stage: "1",
					orderStageType: "1",
				}
		return result;
	},
	datasource: (state) => state.orders.datasource,
	orderPosInfochange: (state) => {
		return state.orders.orderPosInfo.custId;
	},
	unTreeList: (state) => state.orders.unTreeList,
};
export default getters;
